package logic

import (
	"context"
	"develop/model/mysql"

	"develop/usersrpc/internal/svc"
	"develop/usersrpc/usersrpc"

	"github.com/zeromicro/go-zero/core/logx"
)

type CommentListLogic struct {
	ctx    context.Context
	svcCtx *svc.ServiceContext
	logx.Logger
}

func NewCommentListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CommentListLogic {
	return &CommentListLogic{
		ctx:    ctx,
		svcCtx: svcCtx,
		Logger: logx.WithContext(ctx),
	}
}

func (l *CommentListLogic) CommentList(in *usersrpc.CommentListRequest) (*usersrpc.CommentListResponse, error) {
	// todo: add your logic here and delete this line
	commentList := mysql.CommentList(mysql.DB, in)
	return &usersrpc.CommentListResponse{
		List: commentList,
	}, nil
}
